﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>角色管理</title>
     <script src="../../Scripts/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../../Content/JS/layer-v1.7.1/layer/layer.js" type="text/javascript"></script>
    <link href="../../Content/Themes/blue2/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
       .show_role_table{ overflow:scroll; width:98%; margin:0 auto;}
      .role_table{width:700px; border-color:#1C1C1C; overflow:scroll;text-align:center;border-collapse:collapse; border-spacing:0; margin-bottom:10px;  margin-top:5px;}
      .role_table th,td{ word-break:keep-all; white-space:nowrap;  border:1px black solid ; padding:3px; }
      .clickColor{ background-color:#bed3ef;}
      .ShowBtn{ text-align:right; margin-right:10px;}
    </style>
</head>
<body class="main">
     <div class="AllWebTopDiv">
        <div class="path">
            <div class="nav">
                <a href="#">角色管理</a>
                 <div class="ShowBtn"> 
                <input  type="button" id="exit" value="退出" onclick="closeWindows();"  class="button2"/>
               </div>
            </div>
        </div>
        <div class="content">
        <div class="show_role_table">
         <table class="role_table">
          <tr class="DGHeaderStyle">
           <th>角色名</th>
           <th>会员消费</th>
           <th>会员充值</th>
           <th>添加会员</th>
           <th>修改卡密码</th>
           <th>查找会员</th>
           <th>挂失办理</th>
           <th>系统锁屏</th>
           <th>卡金提醒</th>
           <th>生日提醒</th>
           <th>用户管理</th>
           <th>批量会员导出</th>
           <th>群发邮件</th>
           <th>卡面设计</th>
           <th>会员等级</th>
           <th>商品设置</th>
           <th>操作员管理</th>
           <th>智能决策管理</th>
           <th>角色管理</th>
           <th>客户查询</th>
           <th>用户贡献度查询</th>
           <th>商品查询</th>
           <th>会员统计</th>
           <th>年龄分析</th>
           <th>商品饼图查询</th>
           <th>系统日志</th>
           <th>无卡用户流水</th>
           <th>消费流水</th>
           <th>商品流水</th>
           <th>折扣查询</th>
           <th>进卡</th>
           <th>出卡</th>
           <th>清洗机器</th>
           <th>删除卡面内容</th>
          </tr>
          <tr  ondblclick="selectThis('系统管理员')">
           <td><%:ViewData["Admin_roleName"] %></td>
           <td><%:Html.CheckBox("Admin_memberConsume")%></td>
           <td><%:Html.CheckBox("Admin_memberRecharge")%></td>
           <td><%:Html.CheckBox("Admin_memberAdd")%></td>
           <td><%:Html.CheckBox("Admin_changeCardPwd")%></td>
           <td><%:Html.CheckBox("Admin_memberSelect")%></td>
           <td><%:Html.CheckBox("Admin_lostCard")%></td>
           <td><%:Html.CheckBox("Admin_lock")%></td>
           <td><%:Html.CheckBox("Admin_balanceRemind")%></td>
           <td><%:Html.CheckBox("Admin_birthdayRemind")%></td>
           <td><%:Html.CheckBox("Admin_userManager")%></td>
           <td><%:Html.CheckBox("Admin_inputExcel")%></td>
           <td><%:Html.CheckBox("Admin_email")%></td>
            <td><%:Html.CheckBox("Admin_cardDesign")%></td>
            <td><%:Html.CheckBox("Admin_memeberLevel")%></td>
            <td><%:Html.CheckBox("Admin_Produce")%></td>
           <td><%:Html.CheckBox("Admin_opeatorManager")%></td>
           <td><%:Html.CheckBox("Admin_zhinengjuece")%></td>
           <td><%:Html.CheckBox("Admin_roleManger")%></td>
           <td><%:Html.CheckBox("Admin_consumerManager")%></td>
           <td><%:Html.CheckBox("Admin_usergongxian")%></td>
           <td><%:Html.CheckBox("Admin_goodsSelect")%></td>
           <td><%:Html.CheckBox("Admin_memberCount")%></td>
           <td><%:Html.CheckBox("Admin_ageAnalyse")%></td>
           <td><%:Html.CheckBox("Admin_goodsPie")%></td>
           <td><%:Html.CheckBox("Admin_systemLog")%></td>
           <td><%:Html.CheckBox("Admin_userWater")%></td>
           <td><%:Html.CheckBox("Admin_consumeWater")%></td>
           <td><%:Html.CheckBox("Admin_goodsWater")%></td>
           <td><%:Html.CheckBox("Admin_discountSelect")%></td>
           <td><%:Html.CheckBox("Admin_card")%></td>
           <td><%:Html.CheckBox("Admin_Acard")%></td>
           <td><%:Html.CheckBox("Admin_wash")%></td>
           <td><%:Html.CheckBox("Admin_delContent")%></td>
          </tr>
           <tr ondblclick="selectThis('普通管理员')">
           <td><%:ViewData["roleName"] %></td>
           <td><%:Html.CheckBox("memberConsume")%></td>
           <td><%:Html.CheckBox("memberRecharge")%></td>
           <td><%:Html.CheckBox("memberAdd")%></td>
           <td><%:Html.CheckBox("changeCardPwd")%></td>
           <td><%:Html.CheckBox("memberSelect")%></td>
           <td><%:Html.CheckBox("lostCard")%></td>
           <td><%:Html.CheckBox("lock")%></td>
           <td><%:Html.CheckBox("balanceRemind")%></td>
           <td><%:Html.CheckBox("birthdayRemind")%></td>
           <td><%:Html.CheckBox("userManager")%></td>
           <td><%:Html.CheckBox("inputExcel")%></td>
           <td><%:Html.CheckBox("email")%></td>
            <td><%:Html.CheckBox("cardDesign")%></td>
            <td><%:Html.CheckBox("memeberLevel")%></td>
            <td><%:Html.CheckBox("Produce")%></td>
           <td><%:Html.CheckBox("opeatorManager")%></td>
           <td><%:Html.CheckBox("zhinengjuece")%></td>
           <td><%:Html.CheckBox("roleManger")%></td>
           <td><%:Html.CheckBox("consumerManager")%></td>
           <td><%:Html.CheckBox("usergongxian") %></td>
           <td><%:Html.CheckBox("goodsSelect") %></td>
           <td><%:Html.CheckBox("memberCount") %></td>
           <td><%:Html.CheckBox("ageAnalyse")%></td>
           <td><%:Html.CheckBox("goodsPie") %></td>
           <td><%:Html.CheckBox("systemLog") %></td>
           <td><%:Html.CheckBox("userWater") %></td>
           <td><%:Html.CheckBox("consumeWater")%></td>
           <td><%:Html.CheckBox("goodsWater") %></td>
           <td><%:Html.CheckBox("discountSelect") %></td>
           <td><%:Html.CheckBox("card") %></td>
           <td><%:Html.CheckBox("Acard") %></td>
           <td><%:Html.CheckBox("wash") %></td>
           <td><%:Html.CheckBox("delContent") %></td>
          </tr>
         </table>
         <input type="hidden" id="isRole" value="<%:ViewData["RoleId"] %>" />
        </div>
    </div>
  </div>
</body>
</html>
<script type="text/javascript">
    $(".role_table tr").each(
      function () {
          $(this).children("td").children("input").click(function () { return false });
      }
    );
      //编辑
      function selectThis(role) {
          var IsAdmin = false;
          var roleName = "";
          var RoleId = $("#isRole").val();
          if (RoleId != "13") {
              alert("只有系统管理员才能编辑权限"); 
              {
                  return false;
              }
          }
          $(".role_table tr").each(
          function () {
              if (role == "系统管理员") {
                  alert("无法编辑系统管理员");
                  IsAdmin = true;
                  return false;
              }
              roleName = $(this).children("td").eq(0).text();
              if (roleName == role) {
                  $(this).children().addClass("clickColor");
              }
              else {
                  $(this).children().removeClass("clickColor");
              }
          }
        );
          if (!IsAdmin) {
              $.layer({
                  type: 2,
                  title: false,
                  closeBtn: false,
                  shadeClose: true, //开启点击遮罩关闭层
                  move: ['.juanmove', true],
                  area: ['450px', '560px'],
                  offset: ['100px', ''],
                  iframe: { src: '<%:Url.Action("editRole","RollInfo") %>' },
                  success: function () {
                      layer.shift('top', 500);
                  }
              });
          }
      }
      //关闭窗口
      function closeWindows() {
          window.location.href = "/Loading/Index/?src=/Desktop/Index/";
      }
</script>
